<template>
  <div class="links">
    <nuxt-link to="/" class="button--grey">首页</nuxt-link>
    <nuxt-link to="/about" class="button--grey">关于我们</nuxt-link>
    <nuxt-link to="/about" class="button--grey" v-if="userDetailInfo && userDetailInfo.user_name">{{ userDetailInfo.user_name }}</nuxt-link>
    <nuxt-link to="/about" class="button--grey" v-if="userDetailInfoEn && userDetailInfoEn.user_name_pinyin">{{ userDetailInfoEn.user_name_pinyin }}</nuxt-link>
    <nuxt-link to="/course" class="button--grey">在线课程</nuxt-link>
    <!--
    <a
      href="https://nuxtjs.org/"
      target="_blank"
      rel="noopener noreferrer"
      class="button--grey"
    >
      Documentation
    </a>
    <a
      href="https://github.com/nuxt/nuxt.js"
      target="_blank"
      rel="noopener noreferrer"
      class="button--grey"
    >
      GitHub
    </a>
    -->
  </div>
</template>

<script>
  import {getCertificate} from '@/api/demo'

  export default {
    props: {
        userDetailInfo: {
            type: Object,
            default: {},
            required: true,
        }
    },
    components: {},
    data() {
      return {
        userDetailInfoEn: {
          user_name_pinyin: 'TIANYE'
        }
      }
    },
    created() {
      // console.log('Navigation-toobar--getCertificate--data', this.userDetailInfoEn)
      getCertificate({id:21964,sign:'318a9ffcc1e9984e8c8f091c18f7103e'}).then(res => {
        // console.log('Navigation-toobar--getCertificate--res', res.data)
        this.userDetailInfoEn = res.data
        // console.log('Navigation-toobar--getCertificate--data', this.userDetailInfoEn)
      }).catch(error => {
        console.log('Navigation-toobar--getCertificate--error', error)
      })
    }
  }
</script>
<style>
</style>
